home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
The World of Computer Software.iso
/
vsc92nov.zip
/
Makefile
< prev
next >
Wrap
Makefile
|
1992-11-02
|
11KB
|
316 lines
#
# This is the Makefile for the Scheme implementation ``vscm'' by
# Matthias Blume. It requires the existence of an ANSI-C-System.
# Use the make-variables below to adapt to your local needs.
#
# Use a Bourne-Shell-like shell:
SHELL = /bin/sh
# The ``delete'' command:
DELETE = rm
FORCEDELETE = $(DELETE) -f
# The SCCS ``get'' command:
GET = get
# The librarian ``ar'':
AR = ar
# The next section describes your local C system.
# CC is the name of your C-Compiler. Use gcc, if available. You MUST
# use an ANSI-C-Compiler.
# OPTFLAGS (e.g. ``-O'', ``-O2'', ``-DNDEBUG'')
# instruct the compiler to produce optimized code.
# With gcc NEVER use plain ``-O'' (there is a bug...)!
# WARNFLAGS (e.g. ``-Wall'') are used to choose the warn level.
# DEBUGFLAGS (e.g. ``-g'', ``-DDEBUG'')
# instruct the compiler to include debugging information and/or code.
# EXTRACFLAGS (e.g. ``-Iincldir'') are extra flags passed to the compile phase.
# EXTRALDFLAGS (e.g. ``-Llibdir'') are extra flags passed to the link phase.
# EXTRALIBS (e.g. ``-lcposix'') are extra libraries, which might be necessary.
# RANLIB is the library randomizer (normally ``ranlib'') or a null command
# if ranlib is not necessary (e.g. ``:'')
# ECHO_N is yes, if you should use ``echo -n'' instead of ``echo ... \c''
# IDENT_PREPROC is ``unmake-ident'' for compilers, which are not capable of
# dealing with the GNU-CC ``# ident'' directive, otherwise it should
# be a null command (see RANLIB).
CC = gcc
OPTFLAGS = -O2 -DNDEBUG
WARNFLAGS = -Wall -Wmissing-prototypes
DEBUGFLAGS = -g
EXTRACFLAGS =
EXTRALDFLAGS =
EXTRALIBS =
RANLIB = ranlib
ECHO_N = yes
IDENT_PREPROC = :
# The next section gives examples for systems, where I know, how it works:
# 1. DECstation (ULTRIX) using gcc (v2.1):
## CC = gcc
## OPTFLAGS = -O2 -DNDEBUG
## WARNFLAGS = -Wall
## DEBUGFLAGS =
## EXTRACFLAGS =
## EXTRALDFLAGS =
## EXTRALIBS =
## RANLIB = ranlib
## ECHO_N = yes
## IDENT_PREPROC = :
#
# 2. HP series 800 or 700, HP-UX:
## CC = cc -Aa
## OPTFLAGS = -O -DNDEBUG
## WARNFLAGS =
## DEBUGFLAGS =
## EXTRACFLAGS = -DEXIT_VOLATILE
## EXTRALDFLAGS =
## EXTRALIBS =
## RANLIB = ranlib
## ECHO_N = no
## IDENT_PREPROC = unmake-ident
#
# 3. ISC 3.2 using gcc (v2.2.2)
## CC = gcc
## OPTFLAGS = -O2 -DNDEBUG
## WARNFLAGS = -Wall
## DEBUGFLAGS =
## EXTRACFLAGS =
## EXTRALDFLAGS =
## EXTRALIBS = -lcposix
## RANLIB = :
## ECHO_N = yes
## IDENT_PREPROC = :
# 4. experimental (lcc)
## CC = lcc
## OPTFLAGS = -DNDEBUG
## WARNFLAGS =
## DEBUGFLAGS =
## EXTRACFLAGS =
## EXTRALDFLAGS =
## EXTRALIBS =
## RANLIB = ranlib
## ECHO_N = yes
## IDENT_PREPROC = :
# Don't fool around with stuff below this line...
.DEFAULT:
@echo I hope, making $< is not necessary...
CFLAGS = $(OPTFLAGS) $(WARNFLAGS) $(DEBUGFLAGS) $(EXTRACFLAGS)
LDFLAGS = $(OPTFLAGS) $(DEBUGFLAGS) $(EXTRALDFLAGS)
CLFLAGS = $(CFLAGS) $(EXTRALDFLAGS)
LIBS = $(EXTRALIBS)
OBJECTS = \
storage.o storext.o identifier.o reader.o keyword.o io.o \
Boolean.o Character.o Cons.o Vector.o String.o \
Procedure.o Promise.o Symbol.o Cont.o \
Primitive.o Code.o Number.o Fixnum.o Port.o \
except.o main.o list-prim.o misc-prim.o bool-prim.o equiv-prim.o \
sym-prim.o num-prim.o vect-prim.o contr-prim.o sc-prim.o \
tmpstring.o gcstat.o
TMPLIBS = non-ansi-lib
.PRECIOUS: $(TMPLIBS)
all: unmake-ident scheme .scheme-boot scmcomp/cfilt.boot
unmake-ident: s.unmake-ident
-if [ -f s.unmake-ident ]; then $(GET) s.unmake-ident; else exit 0; fi
chmod +x unmake-ident
make-asm: s.make-asm
-if [ -f s.make-asm ]; then $(GET) s.make-asm; else exit 0; fi
chmod +x make-asm
#
# Dependencies:
#
Boolean.o: storext.h Boolean.h storage.h type.h identifier.h except.h
Character.o: storext.h Character.h storage.h type.h identifier.h except.h
Code.o: storext.h Code.h storage.h Vector.h Cont.h Symbol.h \
String.h Cons.h Boolean.h Procedure.h Promise.h Primitive.h \
Number.h identifier.h type.h except.h keyword.h speccont.h \
mode.h
Cons.o: storext.h Cons.h storage.h identifier.h keyword.h Boolean.h \
type.h
Cont.o: storext.h Cont.h storage.h Vector.h Code.h \
identifier.h stack-t.h type.h except.h speccont.h
Fixnum.o: ushort-digs.h storext.h Fixnum.h storage.h identifier.h \
type.h Cont.h Vector.h Code.h cont-hex.h except.h
Number.o: storext.h Number.h storage.h Fixnum.h identifier.h \
Cont.h Vector.h Code.h type.h except.h
Port.o: storext.h Port.h storage.h identifier.h except.h type.h
Primitive.o: storext.h Primitive.h storage.h identifier.h type.h except.h \
builtins.tab
Procedure.o: storext.h Procedure.h storage.h identifier.h
Promise.o: storext.h Promise.h storage.h identifier.h
String.o: storext.h String.h storage.h identifier.h type.h except.h
Symbol.o: storext.h Symbol.h storage.h Primitive.h identifier.h type.h \
except.h
Vector.o: storext.h Vector.h storage.h identifier.h type.h except.h
bool-prim.o: Boolean.h storage.h Cont.h Vector.h Code.h builtins.tab
contr-prim.o: Cont.h storage.h Vector.h Code.h Procedure.h \
Primitive.h Promise.h Boolean.h Cons.h except.h type.h \
builtins.tab
equiv-prim.o: Cont.h storage.h Vector.h Code.h Boolean.h storext.h \
builtins.tab
except.o: Cont.h storage.h Vector.h Code.h String.h except.h \
m-except.h io.h storext.h type.h mode.h
gcstat.o: storage.h Cont.h Vector.h Code.h Number.h \
speccont.h mode.h except.h
identifier.o: storage.h identifier.h type.h Boolean.h Character.h Cons.h \
Procedure.h Promise.h String.h Symbol.h Vector.h \
Cont.h Code.h Primitive.h Port.h Number.h Fixnum.h
io.o: io.h Port.h storage.h reader.h storext.h Cont.h \
Vector.h Code.h Boolean.h String.h Character.h Number.h \
mode.h type.h tmpstring.h except.h builtins.tab
keyword.o: keyword.h storage.h Symbol.h
list-prim.o: Cont.h storage.h Vector.h Code.h Boolean.h Cons.h \
Number.h storext.h type.h except.h builtins.tab
main.o: main.h std-ansi.h storage.h storext.h keyword.h reader.h \
except.h Cont.h Vector.h Code.h Boolean.h Symbol.h \
io.h m-except.h speccont.h
misc-prim.o: storage.h Cont.h Vector.h Code.h Number.h String.h \
Boolean.h Primitive.h type.h tmpstring.h mode.h except.h \
builtins.tab
mkalign.o:
mkconthex.o:
mkdigs.o:
num-prim.o: Cont.h storage.h Vector.h Code.h Number.h Fixnum.h \
Boolean.h Cons.h storext.h type.h except.h builtins.tab
reader.o: reader.h keyword.h Cont.h storage.h Vector.h Code.h \
type.h Cons.h Character.h String.h Symbol.h Boolean.h \
Fixnum.h Number.h except.h
storage.o: align.h storage.h storage-t.h except.h
storext.o: storage.h storext.h
sc-prim.o: String.h storage.h Character.h Boolean.h Cont.h \
Vector.h Code.h Number.h Cons.h type.h except.h \
builtins.tab
sym-prim.o: storage.h Cont.h Vector.h Code.h Symbol.h String.h \
Boolean.h type.h except.h tmpstring.h builtins.tab
tmpstring.o: tmpstring.h except.h
vect-prim.o: Code.h storage.h Vector.h Cont.h Boolean.h Number.h \
Cons.h type.h except.h builtins.tab
tstorage.o: main.h std-ansi.h storage.h
#
# Rules:
#
objects: $(OBJECTS)
align.h: mkalign
mkalign >align.h
ushort-digs.h: mkdigs
mkdigs >ushort-digs.h
cont-hex.h: mkconthex
mkconthex >cont-hex.h
.c.o:
$(IDENT_PREPROC) $<
$(CC) $(CFLAGS) -c $<
.c~.o:
-if [ -f s.$*.c ]; then $(GET) s.$*.c; else exit 0; fi
$(IDENT_PREPROC) $*.c
$(CC) $(CFLAGS) -c $*.c
.c:
$(IDENT_PREPROC) $<
$(CC) -o $* $(CLFLAGS) $< $(LIBS)
.c~:
-if [ -f s.$*.c ]; then $(GET) s.$*.c; else exit 0; fi
$(IDENT_PREPROC) $*.c
$(CC) -o $* $(CLFLAGS) $*.c $(LIBS)
.h~.h:
-if [ -f s.$*.h ]; then $(GET) s.$*.h; else exit 0; fi
.c~.c:
-if [ -f s.$*.c ]; then $(GET) s.$*.c; else exit 0; fi
builtins.tab: s.builtins.tab
-if [ -f s.builtins.tab ]; then $(GET) s.builtins.tab; else exit 0; fi
non-ansi-lib: non-ansi-lib(fileno.o)
$(RANLIB) non-ansi-lib
@echo non-ansi-lib is now up to date
.c.a:
$(IDENT_PREPROC) $<
$(CC) $(CFLAGS) -c $<
$(AR) rv $@ $*.o
$(FORCEDELETE) $*.o
.c~.a:
-if [ -f s.$*.c ]; then $(GET) s.$*.c; else exit 0; fi
$(IDENT_PREPROC) $*.c
$(CC) $(CFLAGS) -c $*.c
$(AR) rv $@ $*.o
$(FORCEDELETE) $*.o
# Delete all temporary stuff:
clean:
$(FORCEDELETE) mkalign mkdigs mkconthex *.o tstorage \
align.h ushort-digs.h cont-hex.h *.out core \
*.pixie *.Addrs *.Counts *.a \
scmcomp/oldfilt.boot scmcomp/oldboot.asm
# Delete stuff related to this machine architecture:
archclean: clean
$(FORCEDELETE) scheme .scheme-boot scmcomp/boot.asm
# Delete everything, which is not absolutely necessary to bootstrap from:
distclean: archclean
$(FORCEDELETE) scmcomp/repl.boot
scheme: $(OBJECTS) $(TMPLIBS)
$(CC) -o scheme $(LDFLAGS) $(OBJECTS) $(LIBS) $(TMPLIBS)
.scheme-boot: scmcomp/repl.boot
cp scmcomp/repl.boot .scheme-boot
scmcomp/cfilt.boot: format.time scmcomp/boot.asm scmcomp/cfilt-ml.asm
cat scmcomp/boot.asm scmcomp/cfilt-ml.asm | \
scheme -b - -a - -d scmcomp/cfilt.boot
scmcomp/repl.boot: format.time scmcomp/boot.asm scmcomp/repl-ml.asm
cat scmcomp/boot.asm scmcomp/repl-ml.asm | \
scheme -b - -a - -d scmcomp/repl.boot
scmcomp/boot.asm: make-asm scmcomp/boot-c.scm
@make-asm $(ECHO_N)
scmcomp/boot-c.scm: scmcomp/s.boot-c.scm
-(cd scmcomp; \
if [ -f s.boot-c.scm ]; then $(GET) s.boot-c.scm; else exit 0; fi)
# The following section contains stuff related to ULTRIX's
# profiling system (pixie):
scheme.pixie: scheme
pixie -o scheme.pixie scheme
prof: scheme.pixie .scheme-boot
./scheme.pixie
prof -pixie scheme | more
# Compiling a program to test the storage module:
# Use the commented-out line, if malloc/realloc/free is not ANSI!
TESTOBJ = storage.o tstorage.o
tstorage: $(TESTOBJ)
$(CC) -o tstorage $(LDFLAGS) $(TESTOBJ) $(LIBS)
# $(CC) -o tstorage -DBAD_REALLOC $(LDFLAGS) $(TESTOBJ) $(LIBS)